<?php
/*

*/	add_theme_support( 'woocommerce' );

	remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
	add_action( 'woocommerce_before_main_content', 'sw_woocommerce_breadcrumb', 20, 0 );
	function sw_woocommerce_breadcrumb( $args = array() ) {

		$defaults = apply_filters( 'woocommerce_breadcrumb_defaults', array(
			'delimiter'   => ' <li class="divider">
				<icon class="icon-double-angle-right"></icon>
			</li> ',
			'wrap_before' => '<div class="breadcrumbs"><ul class="breadcrumb" ' . ( is_single() ? 'itemprop="breadcrumb"' : '' ) . '>',
			'wrap_after'  => '</ul></div>',
			'before'      => '<li>',
			'after'       => '</li>',
			'home'        => _x( 'Home', 'breadcrumb', 'woocommerce' ),
		) );

		$args = wp_parse_args( $args, $defaults );

		wc_get_template( 'global/breadcrumb.php', $args );
	}
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
add_action( 'woocommerce_before_shop_loop_item_title', 'sw_woocommerce_template_loop_product_thumbnail', 10 );
	function sw_product_thumbnail( $size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0  ) {
		global $post;
		$html = '';
		$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), '' );
		if ( has_post_thumbnail() ){
			$html .= get_the_post_thumbnail( $post->ID, $size );
			$html .= '<div class="item-opacity"><span class="product_zoom">';
			$html .= '<a href="'.$image[0].'" id="product_'.$post->ID.'" class="group cboxElement">';
			$html .= '</a> </span> </div>';
			return $html;
		}elseif( wc_placeholder_img_src() ){
			$html .= wc_placeholder_img( $size );
			return $html;
		}
	}
	function sw_woocommerce_template_loop_product_thumbnail(){
		echo sw_product_thumbnail();
	}

remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
add_action( 'woocommerce_after_shop_loop_item', 'sw_woocommerce_template_loop_price', 5 );
function sw_woocommerce_template_loop_price(){
	wc_get_template( 'loop/price.php' );
}

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
add_action( 'woocommerce_single_product_summary', 'sw_woocommerce_template_single_excerpt', 35 );
function sw_woocommerce_template_single_excerpt() {
	wc_get_template( 'single-product/short-description.php' );
}
function number_product_incat(){
	return 9;
}
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
add_filter( 'loop_shop_per_page', 'number_product_incat', 20 );

